uuid =
{
	total = os.time(),
	RAND_MAX = 2147483647,
}
function uuid:generate()
	math.randomseed(os.time()*19%9789 + uuid.total )
	local a = math.random(uuid.RAND_MAX)

	math.randomseed(os.time()*78%9559 + uuid.total )
	local seed = os.time ()*17%4487
	while 0 == seed do
		seed = os.time ()*29%9989
	end
	local b = math.random(seed)

	math.randomseed(os.time()*71%857 + uuid.total )
	local seed = os.time()*13%877
	while 0 == seed do
		seed = os.time()*37%978
	end
	local c = math.random(seed)

	math.randomseed(os.time()*97%6728 + uuid.total )
	local seed = os.time()*31%5837
	while 0 == seed do
		seed = os.time()*11%9089
	end
	local d = math.random(seed)

	math.randomseed(os.time()*97%8628 + uuid.total )
	local seed = os.time()*31%3237
	while 0 == seed do
		seed = os.time()*11%4879
	end
	local e = math.random(seed)

	math.randomseed(os.time()*61%9269 + uuid.total )
	local f = math.random(uuid.RAND_MAX)

	local out = string.format("%08x-%04x-4%03x-%04x-%04x%08x",a,b,c,d,e,f)
	uuid.total =  ( uuid.total + a + b + c + d + e ) % 21345
	return out
end
